package com.manyauthenticationway.server.manyauthenticationway.config.security

import org.springframework.context.annotation.Bean
import org.springframework.core.annotation.Order
import org.springframework.http.HttpMethod
import org.springframework.security.authentication.AuthenticationManager
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter

//@Order(2)//resourceServer执行顺序为3，websecurity必须在此之前完成
@EnableWebSecurity//开启spring security 功能
//@EnableGlobalMethodSecurity//(prePostEnabled = true, securedEnabled = true, jsr250Enabled = true)//开启spring security 注解，如@PreAuthorize,@PreFilter等
class WebSecurityConfig: WebSecurityConfigurerAdapter() {

    @Bean("authenticationManagerBean")
    override fun authenticationManagerBean(): AuthenticationManager {
        return super.authenticationManagerBean() ;
    }
}